<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
  <style>
    * {
      margin: 0;
      padding: 0;
    }

    .nav {
      margin: 50px auto;

      width: 640px;
      height: 50px;
      background-color: pink;
    }

    ul {
      list-style: none;
    }

    .nav li {
      float: left;
    }

    .nav li a {
      /* 1.浮动/display */
      display: inline-block;

      /* 2.盒子模型 */
      width: 80px;
      height: 50px;
      /* background-color: green; */

      /* 3.文字细节 */
      text-align: center;
      line-height: 50px;
      text-decoration: none;
      color: white;
    }

    .nav li a:hover {
      background-color: green;
    }
  </style>
</head>

<body>
  <!-- 做网站主导航要套li a结构 -->
  <!-- nav就是导航的意思 -->
  <div class="nav">
    <ul>
      <li><a href="">新闻1</a></li>
      <li><a href="">新闻2</a></li>
      <li><a href="">新闻3</a></li>
      <li><a href="">新闻4</a></li>
      <li><a href="">新闻5</a></li>
      <li><a href="">新闻6</a></li>
      <li><a href="">新闻7</a></li>
      <li><a href="">新闻8</a></li>
    </ul>
  </div>

</body>

</html>